//
//  NSLayoutConstraint+AG.swift
//  ASW
//
//  Created by zhuxuhong on 2020/11/24.
//

import UIKit

extension NSLayoutConstraint {
    public func bw_setMultiplier(_ value: CGFloat) {
        Self.deactivate([self])

        let newConstraint = NSLayoutConstraint(item: firstItem, attribute: firstAttribute, relatedBy: relation, toItem: secondItem, attribute: secondAttribute, multiplier: value, constant: constant)

        newConstraint.priority = priority
        newConstraint.shouldBeArchived = shouldBeArchived
        newConstraint.identifier = identifier

        Self.activate([newConstraint])
    }
}
